#!/bin/bash
#首先检查服务器上面是否存在docker并且确认docker版本
req=` `
pIDa=` yum list installed | grep  docker & docker --version`
echo $pIDa
if [ $? -eq 1 ];
then
   echo "$no$rqpdocker已安装"
else
   echo "$no$reqdocker未安装"
fi
#安装docker以及相关的依赖
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-compose-plugin
#启动docker并且查看docker的状态
systemctl start docker & systemctl status docker
#启动和挂载spug
docker run -d --restart=always --name=spug -p 8085:80 -v /mydata/:/data registry.aliyuncs.com/openspug/spug

